#include <graphics/node.h>
#include <QtOpenGL/qglshaderprogram.h>

namespace yam3d
{
namespace graphics
{

Node::Node()
    : m_orientation(1,0,0,0)
    , m_translation(0,0,0)
{
}

Node::~Node()
{
}

void Node::setTranslation( const math::vec3& translation )
{
    m_translation = translation;
}

void Node::setOrientation( const math::quat& orientation )
{
    m_orientation = orientation;
}

const math::vec3& Node::getTranslation() const
{
    return m_translation;
}

const math::quat& Node::getOrientation() const
{
    return m_orientation;
}

math::mat4 Node::getTransform() const
{
    math::mat4 res;
    res.setToIdentity();

    res.translate(getTranslation());
    res.rotate(getOrientation());
    return res;
}

}
}


